<div class="content-section introduction">
    <div class="feature-intro">
        <h1>Menubar</h1>
        <p>Menubar is a horizontal menu component.</p>
    </div>
    <app-demoActions github="menubar" stackblitz="menubar-demo"></app-demoActions>
</div>

<div class="content-section implementation">
    <div class="card">
        <p-menubar [model]="items">
            <ng-template pTemplate="start">
                <img src="assets/showcase/images/primeng.svg" height="40" class="mr-2">
            </ng-template>
            <ng-template pTemplate="end">
                <input type="text" pInputText placeholder="Search">
            </ng-template>
        </p-menubar>
    </div>
</div>

<div class="content-section documentation">
    <p-tabView>
        <p-tabPanel header="Documentation">
            <h5>Import</h5>
<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;MenubarModule&#125; from 'primeng/menubar';
import &#123;MenuItem&#125; from 'primeng/api';
</app-code>

            <h5>MenuModel API</h5>
            <p>Menubar uses the common menumodel api to define its items, visit <a [routerLink]="['/menumodel']">MenuModel API</a> for details.</p>

            <h5>Getting Started</h5>
            <p>Menubar requires nested menuitems as its model.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-menubar [model]="items"&gt;&lt;/p-menubar&gt;
</app-code>

<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
export class MenubarDemo &#123;

    items: MenuItem[];

    ngOnInit() &#123;
        this.items = [
            &#123;
                label: 'File',
                items: [&#123;
                        label: 'New', 
                        icon: 'pi pi-fw pi-plus',
                        items: [
                            &#123;label: 'Project'&#125;,
                            &#123;label: 'Other'&#125;,
                        ]
                    &#125;,
                    &#123;label: 'Open'&#125;,
                    &#123;label: 'Quit'&#125;
                ]
            &#125;,
            &#123;
                label: 'Edit',
                icon: 'pi pi-fw pi-pencil',
                items: [
                    &#123;label: 'Delete', icon: 'pi pi-fw pi-trash'&#125;,
                    &#123;label: 'Refresh', icon: 'pi pi-fw pi-refresh'&#125;
                ]
            &#125;
        ];
    &#125;
&#125;
</app-code>

<h5>Custom Content</h5>
<p>Custom content can be placed between p-menubar tags.</p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-menubar [model]="items"&gt;
    &lt;input type="text" pInputText placeholder="Search"&gt;
    &lt;button pButton label="Logout" icon="pi pi-power-off"&gt;&lt;/button&gt;
&lt;/p-menubar&gt;
</app-code>

            <h5>Properties</h5>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>model</td>
                            <td>array</td>
                            <td>null</td>
                            <td>An array of menuitems.</td>
                        </tr>
                        <tr>
                            <td>style</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Inline style of the component.</td>
                        </tr>
                        <tr>
                            <td>styleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the component.</td>
                        </tr>
                        <tr>
                            <td>baseZIndex</td>
                            <td>number</td>
                            <td>0</td>
                            <td>Base zIndex value to use in layering.</td>
                        </tr>
                        <tr>
                            <td>autoZIndex</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Whether to automatically manage layering.</td>
                        </tr>
                        <tr>
                            <td>autoDisplay</td>
                            <td>boolean</td>
                            <td>false</td>
                            <td>Whether to show a root submenu on mouse over.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Templates</h5>
            <div class="doc-tablewrapper">
               <table class="doc-table">
                     <thead>
                        <tr>
                           <th>Name</th>
                           <th>Parameters</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td>start</td>
                           <td>-</td>
                        </tr>
                        <tr>
                           <td>end</td>
                           <td>-</td>
                        </tr>
                     </tbody>
               </table>
            </div>

            <h5>Styling</h5>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>Element</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>p-menubar</td>
                        <td>Container element.</td>
                    </tr>
                    <tr>
                        <td>p-menu-list</td>
                        <td>List element.</td>
                    </tr>
                    <tr>
                        <td>p-menuitem</td>
                        <td>Menuitem element.</td>
                    </tr>
                    <tr>
                        <td>p-menuitem-text</td>
                        <td>Label of a menuitem.</td>
                    </tr>
                    <tr>
                        <td>p-menuitem-icon</td>
                        <td>Icon of a menuitem.</td>
                    </tr>
                    <tr>
                        <td>p-submenu-icon</td>
                        <td>Arrow icon of a submenu.</td>
                    </tr>
                    </tbody>
                </table>
            </div>

            <h5>Dependencies</h5>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/menubar" class="btn-viewsource" target="_blank">
                <span>View on GitHub</span>
            </a>
            <a href="https://stackblitz.com/edit/primeng-menubar-demo" class="btn-viewsource" style="margin-left: .5em;" target="_blank">
                <span>Edit in StackBlitz</span>
            </a>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-menubar [model]="items"&gt;
    &lt;ng-template pTemplate="start"&gt;
        &lt;img src="assets/showcase/images/primeng.svg" height="40" class="mr-2"&gt;
    &lt;/ng-template&gt;
    &lt;ng-template pTemplate="end"&gt;
        &lt;input type="text" pInputText placeholder="Search"&gt;
    &lt;/ng-template&gt;
&lt;/p-menubar&gt;
</app-code>

<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
export class MenubarDemo &#123;

    items: MenuItem[];

    ngOnInit() &#123;
        this.items = [
            &#123;
                label:'File',
                icon:'pi pi-fw pi-file',
                items:[
                    &#123;
                        label:'New',
                        icon:'pi pi-fw pi-plus',
                        items:[
                        &#123;
                            label:'Bookmark',
                            icon:'pi pi-fw pi-bookmark'
                        &#125;,
                        &#123;
                            label:'Video',
                            icon:'pi pi-fw pi-video'
                        &#125;,

                        ]
                    &#125;,
                    &#123;
                        label:'Delete',
                        icon:'pi pi-fw pi-trash'
                    &#125;,
                    &#123;
                        separator:true
                    &#125;,
                    &#123;
                        label:'Export',
                        icon:'pi pi-fw pi-external-link'
                    &#125;
                ]
            &#125;,
            &#123;
                label:'Edit',
                icon:'pi pi-fw pi-pencil',
                items:[
                    &#123;
                        label:'Left',
                        icon:'pi pi-fw pi-align-left'
                    &#125;,
                    &#123;
                        label:'Right',
                        icon:'pi pi-fw pi-align-right'
                    &#125;,
                    &#123;
                        label:'Center',
                        icon:'pi pi-fw pi-align-center'
                    &#125;,
                    &#123;
                        label:'Justify',
                        icon:'pi pi-fw pi-align-justify'
                    &#125;,

                ]
            &#125;,
            &#123;
                label:'Users',
                icon:'pi pi-fw pi-user',
                items:[
                    &#123;
                        label:'New',
                        icon:'pi pi-fw pi-user-plus',

                    &#125;,
                    &#123;
                        label:'Delete',
                        icon:'pi pi-fw pi-user-minus',

                    &#125;,
                    &#123;
                        label:'Search',
                        icon:'pi pi-fw pi-users',
                        items:[
                        &#123;
                            label:'Filter',
                            icon:'pi pi-fw pi-filter',
                            items:[
                                &#123;
                                    label:'Print',
                                    icon:'pi pi-fw pi-print'
                                &#125;
                            ]
                        &#125;,
                        &#123;
                            icon:'pi pi-fw pi-bars',
                            label:'List'
                        &#125;
                        ]
                    &#125;
                ]
            &#125;,
            &#123;
                label:'Events',
                icon:'pi pi-fw pi-calendar',
                items:[
                    &#123;
                        label:'Edit',
                        icon:'pi pi-fw pi-pencil',
                        items:[
                        &#123;
                            label:'Save',
                            icon:'pi pi-fw pi-calendar-plus'
                        &#125;,
                        &#123;
                            label:'Delete',
                            icon:'pi pi-fw pi-calendar-minus'
                        &#125;,

                        ]
                    &#125;,
                    &#123;
                        label:'Archieve',
                        icon:'pi pi-fw pi-calendar-times',
                        items:[
                        &#123;
                            label:'Remove',
                            icon:'pi pi-fw pi-calendar-minus'
                        &#125;
                        ]
                    &#125;
                ]
            &#125;,
            &#123;
                label:'Quit',
                icon:'pi pi-fw pi-power-off'
            &#125;
        ];
    &#125;
&#125;
</app-code>
        </p-tabPanel>
        <p-tabPanel header="StackBlitz">
            <ng-template pTemplate="content">
                <iframe src="https://stackblitz.com/edit/primeng-menubar-demo?embed=1" style="width: 100%; height: 768px; border: none;"></iframe>
            </ng-template>
        </p-tabPanel>
    </p-tabView>
</div>
